﻿using System;
using System.Web;
using System.Web.Mvc;

namespace WebSite.ViewModels.Fields
{
    public abstract class FieldBase : IField
    {
        public string Caption { get; private set; }
        public string Name { get; private set; }
        public bool IsOneRow { get; private set; }
        public bool IsEmpty { get { return false; } }
        public object Value { get; protected set; }

        protected FieldBase(string caption, string name, object value, bool isOneRow = false)
        {
            Caption = caption;
            Name = name;
            IsOneRow = isOneRow;
            Value = value;
        }

        public abstract IHtmlString Render(HtmlHelper htmlHelper);
    }

    public static class FieldHelper
    {
        public static DateTime? EmptyDate = null;
        public const string EmptyText = null;
    }
}